package com.ygxsk.carhome.ui.archive;

import android.os.Parcel;
import android.os.Parcelable;

import com.ygxsk.carhome.enumwrap.ArchiveVehicleType;
import com.ygxsk.carhome.response.ArchivesManageFileMy;
import com.ygxsk.carhome.response.InformationAccessoryUpLoad;

import java.util.ArrayList;

/*
 * @Author:itchenqi175@163.com
 * @Time:2023-08-19  09:19
 * @Description:修改单个的 例如客户信息或者车辆信息从详情内携带的数据；
 */
public class InformationManageVoExtra implements Parcelable {

    //设置 这条车辆档案的id，档案的id，这里不能用 vehicleId 了，在2023-11-9 17:14:40修改为 档案id
//    private String vehicleId;
    private String informationId;

    //客户信息单个的
    private ClientManageSingleUpLoad clientManageSingleUpLoad = new ClientManageSingleUpLoad();

    //车辆信息
    //车辆类型 默认是1,是新车的合同，是新车的档案
    private String vehicleType = ArchiveVehicleType.VEHICLETYPE_CAR_NEW.getIndex();
    //车辆品牌 这个仅仅是车辆品牌的id,数字格式的
    private String carBranch;
    //车辆品牌-的汉字格式
    private String carBranchName;
    //车辆车系
    private String carSeries;
    //车辆车系的名称
    private String carSeriesName;

    //车型
    private String carModel;
    //车牌号
    private String licenseNumber;
    //车架号
    private String vin;
    //发动机号  引擎号
    private String engineNum;

    //携带合同列表，是内部列表添加的
    private ArrayList<ArchivesManageSingleUpLoad> archivesManageList = new ArrayList<>();

    //携带底部档案的附件列表
    private ArrayList<InformationAccessoryUpLoad> informationAccessoryList = new ArrayList<>();

    //携带底部档案的纯粹的url附件，仅仅用在展示图片上，不用做上传。
    private ArrayList<String> informationAccessoryUrlList = new ArrayList<>();

    //携带的动态的附件的信息内容
    private ArrayList<ArchivesManageFileMy> accessorysForApp = new ArrayList<>();


    public ArrayList<ArchivesManageFileMy> getAccessorysForApp() {
        return accessorysForApp;
    }

    public void setAccessorysForApp(ArrayList<ArchivesManageFileMy> accessorysForApp) {
        this.accessorysForApp = accessorysForApp;
    }

    public ArrayList<String> getInformationAccessoryUrlList() {
        return informationAccessoryUrlList;
    }

    public void setInformationAccessoryUrlList(ArrayList<String> informationAccessoryUrlList) {
        this.informationAccessoryUrlList = informationAccessoryUrlList;
    }

//    public String getVehicleId() {
//        return vehicleId;
//    }

//    public void setVehicleId(String vehicleId) {
//        this.vehicleId = vehicleId;
//    }


    public String getInformationId() {
        return informationId;
    }

    public void setInformationId(String informationId) {
        this.informationId = informationId;
    }

    public String getCarSeriesName() {
        return carSeriesName;
    }

    public void setCarSeriesName(String carSeriesName) {
        this.carSeriesName = carSeriesName;
    }

    public String getCarBranchName() {
        return carBranchName;
    }

    public void setCarBranchName(String carBranchName) {
        this.carBranchName = carBranchName;
    }

    public ClientManageSingleUpLoad getClientManageSingleUpLoad() {
        return clientManageSingleUpLoad;
    }

    public void setClientManageSingleUpLoad(ClientManageSingleUpLoad clientManageSingleUpLoad) {
        this.clientManageSingleUpLoad = clientManageSingleUpLoad;
    }

    public String getVehicleType() {
        return vehicleType;
    }

    public void setVehicleType(String vehicleType) {
        this.vehicleType = vehicleType;
    }

    public String getCarBranch() {
        return carBranch;
    }

    public void setCarBranch(String carBranch) {
        this.carBranch = carBranch;
    }

    public String getCarSeries() {
        return carSeries;
    }

    public void setCarSeries(String carSeries) {
        this.carSeries = carSeries;
    }

    public String getCarModel() {
        return carModel;
    }

    public void setCarModel(String carModel) {
        this.carModel = carModel;
    }

    public String getLicenseNumber() {
        return licenseNumber;
    }

    public void setLicenseNumber(String licenseNumber) {
        this.licenseNumber = licenseNumber;
    }

    public String getVin() {
        return vin;
    }

    public void setVin(String vin) {
        this.vin = vin;
    }

    public String getEngineNum() {
        return engineNum;
    }

    public void setEngineNum(String engineNum) {
        this.engineNum = engineNum;
    }

    public ArrayList<ArchivesManageSingleUpLoad> getArchivesManageList() {
        return archivesManageList;
    }

    public void setArchivesManageList(ArrayList<ArchivesManageSingleUpLoad> archivesManageList) {
        this.archivesManageList = archivesManageList;
    }

    public ArrayList<InformationAccessoryUpLoad> getInformationAccessoryList() {
        return informationAccessoryList;
    }

    public void setInformationAccessoryList(ArrayList<InformationAccessoryUpLoad> informationAccessoryList) {
        this.informationAccessoryList = informationAccessoryList;
    }


    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeString(this.informationId);
        dest.writeParcelable(this.clientManageSingleUpLoad, flags);
        dest.writeString(this.vehicleType);
        dest.writeString(this.carBranch);
        dest.writeString(this.carBranchName);
        dest.writeString(this.carSeries);
        dest.writeString(this.carSeriesName);
        dest.writeString(this.carModel);
        dest.writeString(this.licenseNumber);
        dest.writeString(this.vin);
        dest.writeString(this.engineNum);
        dest.writeTypedList(this.archivesManageList);
        dest.writeTypedList(this.informationAccessoryList);
        dest.writeStringList(this.informationAccessoryUrlList);
    }

    public void readFromParcel(Parcel source) {
        this.informationId = source.readString();
        this.clientManageSingleUpLoad = source.readParcelable(ClientManageSingleUpLoad.class.getClassLoader());
        this.vehicleType = source.readString();
        this.carBranch = source.readString();
        this.carBranchName = source.readString();
        this.carSeries = source.readString();
        this.carSeriesName = source.readString();
        this.carModel = source.readString();
        this.licenseNumber = source.readString();
        this.vin = source.readString();
        this.engineNum = source.readString();
        this.archivesManageList = source.createTypedArrayList(ArchivesManageSingleUpLoad.CREATOR);
        this.informationAccessoryList = source.createTypedArrayList(InformationAccessoryUpLoad.CREATOR);
        this.informationAccessoryUrlList = source.createStringArrayList();
    }

    public InformationManageVoExtra() {
    }

    protected InformationManageVoExtra(Parcel in) {
        this.informationId = in.readString();
        this.clientManageSingleUpLoad = in.readParcelable(ClientManageSingleUpLoad.class.getClassLoader());
        this.vehicleType = in.readString();
        this.carBranch = in.readString();
        this.carBranchName = in.readString();
        this.carSeries = in.readString();
        this.carSeriesName = in.readString();
        this.carModel = in.readString();
        this.licenseNumber = in.readString();
        this.vin = in.readString();
        this.engineNum = in.readString();
        this.archivesManageList = in.createTypedArrayList(ArchivesManageSingleUpLoad.CREATOR);
        this.informationAccessoryList = in.createTypedArrayList(InformationAccessoryUpLoad.CREATOR);
        this.informationAccessoryUrlList = in.createStringArrayList();
    }

    public static final Parcelable.Creator<InformationManageVoExtra> CREATOR = new Parcelable.Creator<InformationManageVoExtra>() {
        @Override
        public InformationManageVoExtra createFromParcel(Parcel source) {
            return new InformationManageVoExtra(source);
        }

        @Override
        public InformationManageVoExtra[] newArray(int size) {
            return new InformationManageVoExtra[size];
        }
    };
}


//    POST http://222.222.17.184:8990/auth/v1/vehicle/informationmanage/addInformationManage HTTP/1.1
//    User-Agent: CloudSteward/Mozilla/5.0 (Linux; Android 9; DUK-AL20 Build/HUAWEIDUK-AL20; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/88.0.4324.93 Mobile Safari/537.36
//    Devicecode: 268c7c773de7b3cc1af50370275699324
//    Usertoken: ea9b941982c4dbc2c2d9f07f5c488a0c
//    Content-Type: application/json; charset=utf-8
//    Content-Length: 1493
//    Host: 222.222.17.184:8990
//    Connection: Keep-Alive
//    Accept-Encoding: gzip
//
//    {
//        "archivesManageList":[
//        {
//            "amount":"250000",
//                "archiveNo":"",
//                "archiveTypeId":"1",
//                "archivesManageFileVoList":[
//            {
//                "filePath":"null/20230818/2023081816384755133904_750x750.png"
//            },
//            {
//                "filePath":"null/20230818/2023081816384897186872_750x750.png"
//            },
//            {
//                "filePath":"null/20230818/2023081816385102644935_750x750.png"
//            }
//			],
//            "brandModel":"",
//                "carBrand":"",
//                "partyA":"陈大",
//                "signingDate":"2023-08-30"
//        }
//	],
//        "carBranch":"8",
//            "carModel":"小轿车",
//            "carSeries":"149",
//            "clientManage":{
//        "address":"天同街",
//                "age":"36",
//                "clientName":"陈琪",
//                "companyDetail":"盛邦乡村数科",
//                "email":"chenqi@163.com",
//                "gender":"0",
//                "idCard":"",
//                "phone":"17531108969",
//                "position":"测试程序员",
//                "wechatNumber":"18810042043"
//    },
//        "engineNum":"25486687785",
//            "informationAccessoryList":[
//        {
//            "fileName":"null/20230818/2023081816385624239559.jpg",
//                "filePath":"http://222.222.17.184:8990/resource/null/20230818/2023081816385624239559.jpg",
//                "fileSize":""
//        },
//        {
//            "fileName":"null/20230818/2023081816385648633083.jpg",
//                "filePath":"http://222.222.17.184:8990/resource/null/20230818/2023081816385648633083.jpg",
//                "fileSize":""
//        },
//        {
//            "fileName":"null/20230818/2023081816385668841893.jpg",
//                "filePath":"http://222.222.17.184:8990/resource/null/20230818/2023081816385668841893.jpg",
//                "fileSize":""
//        }
//	],
//        "licenseNumber":"浙CS8417",
//            "shopInfoId":"1495",
//            "vehicleType":"1",
//            "vin":"FGHURUGDE"
//    }
//
//
//
//    响应
//    {
//        "code":"20000",
//            "data":1,
//            "message":"success"
//    }


//    {
//        "code": "20000",
//            "data": {
//        "archivesManageList": [
//        {
//            "amount": 250000.00,
//                "archiveName": "",
//                "archiveNo": "",
//                "archiveStatusId": 0,
//                "archiveTypeId": 1,
//                "archivesId": 2,
//                "archivesManageFileVoList": [
//            {
//                "archivesId": 2,
//                    "createCustomerId": 4,
//                    "createTime": "2023-08-18 16:39:04",
//                    "fileId": 4,
//                    "filePath": "null/20230818/2023081816384755133904_750x750.png",
//                    "isDelete": 0,
//                    "url": "http://222.222.17.184:8990/resource/null/20230818/2023081816384755133904_750x750.png",
//                    "urlPrefix": "http://222.222.17.184:8990/resource/"
//            },
//            {
//                "archivesId": 2,
//                    "createCustomerId": 4,
//                    "createTime": "2023-08-18 16:39:04",
//                    "fileId": 5,
//                    "filePath": "null/20230818/2023081816384897186872_750x750.png",
//                    "isDelete": 0,
//                    "url": "http://222.222.17.184:8990/resource/null/20230818/2023081816384897186872_750x750.png",
//                    "urlPrefix": "http://222.222.17.184:8990/resource/"
//            },
//            {
//                "archivesId": 2,
//                    "createCustomerId": 4,
//                    "createTime": "2023-08-18 16:39:04",
//                    "fileId": 6,
//                    "filePath": "null/20230818/2023081816385102644935_750x750.png",
//                    "isDelete": 0,
//                    "url": "http://222.222.17.184:8990/resource/null/20230818/2023081816385102644935_750x750.png",
//                    "urlPrefix": "http://222.222.17.184:8990/resource/"
//            }
//                ],
//            "archivesTypeName": "购车合同",
//                "auditStatus": 0,
//                "brandModel": "",
//                "carBrand": "",
//                "comment": "",
//                "communityId": "2",
//                "communityName": "长安国际汽车产业园",
//                "companyId": 0,
//                "contactA": "",
//                "contactB": "",
//                "contactC": "",
//                "createCustomerId": 4,
//                "createTime": "2023-08-18 16:39:04",
//                "direction": 0,
//                "filePathList": [
//            "http://222.222.17.184:8990/resource/null/20230818/2023081816384755133904_750x750.png",
//                    "http://222.222.17.184:8990/resource/null/20230818/2023081816384897186872_750x750.png",
//                    "http://222.222.17.184:8990/resource/null/20230818/2023081816385102644935_750x750.png"
//                ],
//            "isDelete": 0,
//                "partyA": "陈大",
//                "partyB": "",
//                "partyC": "",
//                "payer": "",
//                "payerId": 0,
//                "paymentMode": 0,
//                "phoneA": "",
//                "phoneB": "",
//                "phoneC": "",
//                "reason": "",
//                "receiveAmount": 0,
//                "signingDate": "2023-08-30 00:00:00",
//                "updateCustomerId": 0,
//                "urlPrefix": "",
//                "validityNum": 0,
//                "validityUnit": "",
//                "vehicleId": 4
//        },
//        {
//            "amount": 123456.00,
//                "archiveName": "",
//                "archiveNo": "",
//                "archiveStatusId": 0,
//                "archiveTypeId": 1,
//                "archivesId": 9,
//                "archivesManageFileVoList": [
//            {
//                "archivesId": 9,
//                    "createCustomerId": 0,
//                    "createTime": "2023-08-19 15:11:54",
//                    "fileId": 22,
//                    "filePath": "null/20230819/2023081915113978767217.jpg",
//                    "isDelete": 0,
//                    "url": "http://222.222.17.184:8990/resource/null/20230819/2023081915113978767217.jpg",
//                    "urlPrefix": "http://222.222.17.184:8990/resource/"
//            },
//            {
//                "archivesId": 9,
//                    "createCustomerId": 0,
//                    "createTime": "2023-08-19 15:11:54",
//                    "fileId": 23,
//                    "filePath": "null/20230819/2023081915113999960615.jpg",
//                    "isDelete": 0,
//                    "url": "http://222.222.17.184:8990/resource/null/20230819/2023081915113999960615.jpg",
//                    "urlPrefix": "http://222.222.17.184:8990/resource/"
//            },
//            {
//                "archivesId": 9,
//                    "createCustomerId": 0,
//                    "createTime": "2023-08-19 15:11:54",
//                    "fileId": 24,
//                    "filePath": "null/20230819/2023081915114026990748.jpg",
//                    "isDelete": 0,
//                    "url": "http://222.222.17.184:8990/resource/null/20230819/2023081915114026990748.jpg",
//                    "urlPrefix": "http://222.222.17.184:8990/resource/"
//            }
//                ],
//            "archivesTypeName": "购车合同",
//                "auditStatus": 0,
//                "brandModel": "",
//                "carBrand": "",
//                "comment": "",
//                "communityId": "",
//                "communityName": "",
//                "companyId": 0,
//                "contactA": "",
//                "contactB": "",
//                "contactC": "",
//                "createCustomerId": 0,
//                "createTime": "2023-08-19 15:11:54",
//                "direction": 0,
//                "filePathList": [
//            "http://222.222.17.184:8990/resource/null/20230819/2023081915113978767217.jpg",
//                    "http://222.222.17.184:8990/resource/null/20230819/2023081915113999960615.jpg",
//                    "http://222.222.17.184:8990/resource/null/20230819/2023081915114026990748.jpg"
//                ],
//            "isDelete": 0,
//                "partyA": "陈大别",
//                "partyB": "",
//                "partyC": "",
//                "payer": "",
//                "payerId": 0,
//                "paymentMode": 0,
//                "phoneA": "",
//                "phoneB": "",
//                "phoneC": "",
//                "reason": "",
//                "receiveAmount": 0,
//                "signingDate": "2023-09-28 00:00:00",
//                "updateCustomerId": 0,
//                "urlPrefix": "",
//                "validityNum": 0,
//                "validityUnit": "",
//                "vehicleId": 4
//        }
//        ],
//        "auditBy": 0,
//                "auditStatus": 2,
//                "carBranch": 8,
//                "carBranchName": "宝马",
//                "carModel": "小轿车",
//                "carSeries": 149,
//                "carSeriesName": "宝马4系",
//                "clientId": 14,
//                "clientManage": {
//            "address": "天同街",
//                    "age": 36,
//                    "clientId": 14,
//                    "clientName": "陈琪",
//                    "companyDetail": "盛邦乡村数科",
//                    "createBy": 0,
//                    "email": "chenqi@163.com",
//                    "gender": 0,
//                    "idCard": "",
//                    "isDelete": 0,
//                    "phone": "17531108969",
//                    "position": "测试程序员",
//                    "updateBy": 0,
//                    "wechatNumber": "18810042043"
//        },
//        "clientName": "",
//                "clientPhone": "",
//                "communityId": 2,
//                "communityName": "",
//                "companyId": 0,
//                "createBy": 4,
//                "createTime": "2023-08-18 16:39:04",
//                "engineNum": "25486687785",
//                "informationAccessoryList": [
//        {
//            "accessoryId": 6,
//                "auditStatus": 0,
//                "createBy": 4,
//                "createTime": "2023-08-18 16:39:04",
//                "fileName": "null/20230818/2023081816385624239559.jpg",
//                "filePath": "null/20230818/2023081816385624239559.jpg",
//                "fileSize": 0,
//                "isDelete": 0,
//                "reason": "",
//                "updateBy": 0,
//                "url": "http://222.222.17.184:8990/resource/null/20230818/2023081816385624239559.jpg",
//                "urlPrefix": "http://222.222.17.184:8990/resource/",
//                "vehicleId": 4
//        },
//        {
//            "accessoryId": 7,
//                "auditStatus": 0,
//                "createBy": 4,
//                "createTime": "2023-08-18 16:39:04",
//                "fileName": "null/20230818/2023081816385648633083.jpg",
//                "filePath": "null/20230818/2023081816385648633083.jpg",
//                "fileSize": 0,
//                "isDelete": 0,
//                "reason": "",
//                "updateBy": 0,
//                "url": "http://222.222.17.184:8990/resource/null/20230818/2023081816385648633083.jpg",
//                "urlPrefix": "http://222.222.17.184:8990/resource/",
//                "vehicleId": 4
//        },
//        {
//            "accessoryId": 8,
//                "auditStatus": 0,
//                "createBy": 4,
//                "createTime": "2023-08-18 16:39:04",
//                "fileName": "null/20230818/2023081816385668841893.jpg",
//                "filePath": "null/20230818/2023081816385668841893.jpg",
//                "fileSize": 0,
//                "isDelete": 0,
//                "reason": "",
//                "updateBy": 0,
//                "url": "http://222.222.17.184:8990/resource/null/20230818/2023081816385668841893.jpg",
//                "urlPrefix": "http://222.222.17.184:8990/resource/",
//                "vehicleId": 4
//        }
//        ],
//        "informationAccessoryUrlList": [
//        "http://222.222.17.184:8990/resource/null/20230818/2023081816385624239559.jpg",
//                "http://222.222.17.184:8990/resource/null/20230818/2023081816385648633083.jpg",
//                "http://222.222.17.184:8990/resource/null/20230818/2023081816385668841893.jpg"
//        ],
//        "isDelete": 0,
//                "licenseNumber": "浙CS8417",
//                "reason": "",
//                "shopInfoId": 1495,
//                "shopInfoName": "",
//                "updateBy": 0,
//                "updateType": 0,
//                "vehicleId": 4,
//                "vehicleType": 1,
//                "vin": "FGHURUGDE"
//    },
//        "message": "success"
//    }

